<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="/css/common.css" />
		<link rel="stylesheet" type="text/css" href="/js/flatpickr.min.css" />
		<link rel="stylesheet" type="text/css" href="/bootstrap-3.3.7/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="/dialog/css/dialog.css" />
		<link rel="stylesheet" type="text/css" href="/css/font-awesome.css" />
	</head>

	<body>
		<!--顶部导航 -->
		<nav class="topNavItemBox">
			<div id="ItemBox">
				<div class="title">肉品溯源管理系统</div>
			</div>
		</nav>
		<!-- 左侧导航 -->
		<#include "left.ftl"/>

        <!--检疫查询 -->

		<div class="page_main">
			<h3>检疫情况管理</h3><span class="add_link"><a href="/admin/ProInspect/toAddPage">新增检疫情况></a></span>
			<div class="page_content">
				<h4>检疫情况查询</h4>
				<br /><br />
				<form id="quarantineInfo_query" method="post" action="/admin/ProInspect/findByCondition">
					<label>生猪编号</label><input type="text" value="${purGid}" name="purGid" id="productId" class="commonInputtext" />
					<input type="submit" value="查询" style="display: inline-block; margin-left: 50px;" />

					<br />
					<!--<label>按生产企业查询</label><input class="commonInputtext" type="text" name="" id="productId" />-->

				</form>
				<div>
					<table id="quarantine_table" class="table" width="100%">
						<thead>
							<tr>
								<th width="20"><input type="checkbox" onclick="selectAll()" id="allSelect" class="allSelect" ></th>
								<th width="100">生猪编号</th>
								<th width="150">生产企业名称</th>
								<th width="100">检验时间</th>
								<th width="100">检验类型</th>
								<th width="100">检验结果</th>
								<th width="120">检验人编号</th>
								<th width="120">检验人姓名</th>
								<th width="100">检验说明</th>
								<th width="120"></th>
							</tr>
						</thead>
						<tbody>
							<tr id="no_data">
                                <#list pageInfo.list as pro>
                                    <td width="20"><input name="isCheck" type="checkbox" value="${pro.gid}" /></td>
                                    <td width="100">${pro.purcid}</td>
                                    <td width="150">${pro.compid}</td>
                                    <td width="100">${(pro.inspecttime?string('yyyy-MM-dd'))}</td>
                                    <td width="100">${pro.resulttype}</td>
                                    <td width="100">${pro.resultnotes}</td>
                                    <td width="120">${pro.inspectorid}</td>
                                    <td width="120">${pro.inspectorname}</td>
                                    <td width="100">${pro.reserve1}</td>
                                     <td width="120">
                                          <input type="button" onclick="edit1(${carInfoVO.carInfo.carId})"  value="编辑"/>
                                      </td>
                                </tr>
                                </#list>


                                </tbody>
                                </table>
                                </div>
                <input type="button" id="delete" onclick="deleteByids()" value="删除所选">
            </div>
                                <div class="footer">
                                <div class="footer_lineone">
                                <span id="logo"></span>肉品溯源管理系统
                                <span class="footer_lineoneSpan"><a href="aboutus.html">关于我们</a></span>
                            <span class="footer_lineoneSpan"><a target="_blank" href="http://www.cfsiw.com/">食品安全信息</a></span>
                    <span class="footer_lineoneSpan"><a href="suggestionAdd.ftl">联系我们</a></span>
                    </div>
                    <div class="footer_linetwo">
                            &copy;2017广东技术师范学院
                    </div>
                    </div>
                    </div>

                    <script src="/js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/google-maps.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/jquery.form.js"></script>
        <script src="/dialog/js/dialog.js"></script>
        <script src="/js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/messages_zh.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/common.js" type="text/javascript" charset="utf-8"></script>
        <script src="/js/flatpickr.js">
        </script>
        <script type="text/javascript" charset="UTF-8">
            $(function() {
                //初始化侧边栏
                $(".vertical-nav").verticalnav({
                    speed: 400,
                    align: "left"
                });
					//时间控制器
                $("input[name='inspectTime']").flatpickr();
			});


            //全选、全不选
            function selectAll() {
                if ($("#allSelect").is(":checked")) {
                    $("input[name='isCheck']").prop("checked",true);
                } else {
                    $("input[name='isCheck']").prop("checked",false);
                }
            }

            //批量删除
            function deleteByids() {
                var option = $("input[name='isCheck']:checked");
                var selectRows = "";
                for (var i = 0; i < option.length; i++) {
                    if (i == 0) {
                        selectRows += option[i].value;
                    } else {
                        selectRows += "," + option[i].value;
                    }
                }
                    alert(selectRows);

            $.dialog({
                type: 'confirm',
                contentHtml: '<p style:"magrin:0 auto">确认删除？</p>',
                onClickOk: function() {
                    $.ajax({
                        url: "/admin/ProInspect/delete",
                        data: {
                            'selectRows': selectRows
                        },
                        error: function(XMLHttpRequest, textStatus, errorThrown) {
                            //弹失败框
                            $.dialog({
                                type: 'info',
                                contentHtml: '<img class="info-icon" src="dialog/images/icon/fail.png" alt="删除失败" /><p class="info-text">删除失败</p>',
                                autoClose: 1000
                            });
                        },
                        success: function() {
                            //弹成功框
                            $.dialog({
                                type: 'info',
                                contentHtml: '<img class="info-icon" src="dialog/images/icon/success.png" alt="删除成功" /><p class="info-text">删除成功</p>',
                                autoClose: 1000
                            });
                            setTimeout("window.location.reload();",2000);

                        }
                    });
                }
            });

            }

		</script>

	</body>

</html>